package com.xjscrm.console.mapper;

import com.xjscrm.common.entity.MerchatChild;
import com.xjscrm.console.param.user.ChildMerchatQuery;
import com.xjscrm.console.vo.MerchatChildVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MerchatChildMapper extends CommonMapper<MerchatChild> {

    MerchatChild getByAccount(@Param("userAccount") String userAccount,@Param("merId")Long merId);

    int insertMerchatChild(MerchatChild merchatChild);

    MerchatChild getById(@Param("id") Long id,@Param("merId")Long merId);

    void updateChildMerchat(MerchatChild merchatChild);

    List<MerchatChildVo> getMerchatChild(ChildMerchatQuery childMerchatQuery);

    void deleGroupIdById(@Param("id") Long id,@Param("merId")Long merId);

    void deleRoleIdById(@Param("id") Long id,@Param("merId")Long merId);

    int deleMerchatChildById(@Param("id") Long id,@Param("merId")Long merId);

    List<MerchatChild> selectByIds(@Param("merId") Long merId, @Param("ids") List<Long> ids);

    void updateGroupNUll(@Param("id") Long id,@Param("merId")Long merId);

    @Override
    int insertSelective(MerchatChild merchatChild);

    @Override
    int updateByPrimaryKeySelective(MerchatChild merchatChild);

    @Override
    int deleteByPrimaryKey(Long id);

    @Override
    MerchatChild selectByPrimaryKey(Long id);

    List<MerchatChild> selectByIdsAndGroupId(@Param("merId") Long merId, @Param("ids") List<Long> ids, @Param("groupId") Long groupId);
}
